package com.example.controller;

import com.example.entity.paperlessMaintance.PaperlessMaintanceApply;
import com.example.service.PaperlessMaintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("api/paperlessMaint/")
public class PaperlessMaintController {

    @Autowired
    PaperlessMaintService paperlessMaintService;

    @RequestMapping(value = "add", method = RequestMethod.POST)
    public Map<String,Object> add(@RequestBody PaperlessMaintanceApply paperlessMaintanceApply){
        Map<String,Object> result = paperlessMaintService.add(paperlessMaintanceApply);
        return result;
    }

    @RequestMapping(value = "query", method = RequestMethod.POST)
    public Map<String,Object> query(@RequestBody PaperlessMaintanceApply paperlessMaintanceApply){
        Map<String,Object> result = paperlessMaintService.query(paperlessMaintanceApply);
        return result;
    }

    @RequestMapping(value = "update", method = RequestMethod.POST)
    public Map<String,Object> update(@RequestBody PaperlessMaintanceApply paperlessMaintanceApply){
        return paperlessMaintService.update(paperlessMaintanceApply);
    }
}
